package com.friends.digitpic.service.service.impl;

import javax.annotation.Resource;

import org.jeecgframework.minidao.pojo.MiniDaoPage;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Component;
import com.friends.digitpic.service.dao.PicDao;
import com.friends.digitpic.service.entity.PicEntity;
import com.friends.digitpic.service.service.PicService;

/**
 * 描述：图片
 * @author: jiangge xia
 * @since：2018年09月15日 22时44分21秒 星期六 
 * @version:1.0
 */

@Transactional
@Component
public class PicServiceImpl implements PicService {

	@Resource(name = "picDao")
	private PicDao picDao;


	public PicEntity getPic(String picid) {
		return picDao.get(picid);
	}

	public int updatePic(PicEntity pic) {
		return picDao.update(pic);
	}

	public void insertPic(PicEntity pic) {
		picDao.insert(pic);
		
	}

	public MiniDaoPage<PicEntity> getPicAll(PicEntity pic, int page, int rows) {
		return picDao.getAll(pic, page, rows);
	}

	public void deletePic(PicEntity pic) {
		picDao.delete(pic);
		
	}
}
